package com.hotec.PROJECT_NAME.config.security.token;

import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;

/**
 * 后台标识的token
 * @author 黑山老妖
 * @date 2018/10/10
 */
public class XcxUsernamePasswordAuthenticationToken extends AbstractAuthenticationToken {
    private final Object principal;
    private Object credentials;
    private String type;

    public XcxUsernamePasswordAuthenticationToken(Object principal, Object credentials, String type,Collection<? extends GrantedAuthority> authorities) {
        super(authorities);
        this.principal = principal;
        this.credentials = credentials;
        this.type=type;
        super.setAuthenticated(true);
    }


    @Override
    public Object getCredentials() {
        return credentials;
    }

    @Override
    public Object getPrincipal() {
        return principal;
    }

    public Object getType() {
        return type;
    }


}
